package com.iweb.service.impl;

import com.iweb.dao.EmpDao;
import com.iweb.dao.MerchantDao;
import com.iweb.pojo.Merchant;
import com.iweb.service.MerchantService;

/**
 * @author: jack
 * @date: 2022-08-05 0005
 * @ApiNOTE:
 */
public class MerchantServiceImpl implements MerchantService {

  private MerchantDao merchantDao;

  private EmpDao empDao;

  public void setEmpDao(EmpDao empDao) {
    this.empDao = empDao;
  }

  public void setMerchantDao(MerchantDao merchantDao) {
    this.merchantDao = merchantDao;
  }

  @Override
  public Merchant findMerchant(Integer empId) {
    // 根据 empid 找到 商家id
    Integer merchantId = empDao.selectMerchantIdByEmpId(empId);
    // 根据商家id 找到商家信息
    Merchant merchant = merchantDao.selectById(merchantId);
    return merchant;
  }
}
